package com.sunfeng.commonlib.message;

/**
 * 通用 Message常量定义类
 * Created by wutiaorong on 2017/10/19.
 */

public class CommonMessage {
    private final String mMessage;
    private final Type mType;
    private Object mWhat;

    public enum Type {
        SCREEN_ON, // 屏幕解锁
        SCREEN_OFF, // 锁屏事件
        UPDATE_ORDER, // 轮询定时消息
        LOCATION, // 定位功能：执行定位
        CHANGE_LOCATION_SPAN, // 定位功能：修改定位间隔事件
    }

    public interface TypeInt {
        int LOCATION = 7;
        int UPDATE_ORDER = 8;
        int SCREEN_ON = 9;
        int SCREEN_OFF = 10;
    }
    public interface Action {
        String LOCATION = "rider.action.location";
        String UPDATE_ORDER = "rider.action.update_order";
    }

    public Type getType() {
        return mType;
    }

    public Object getWhat() {
        return mWhat;
    }

    public String getMessage() {
        return mMessage;
    }

    public CommonMessage(Type type, String message) {
        this.mType = type;
        this.mMessage = message;
    }

    public CommonMessage(Type type, String message, Object what) {
        this.mType = type;
        this.mMessage = message;
        this.mWhat = what;
    }
}